/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package b_and_b_properties;

import b_and_b_properties.data.DAO;
import b_and_b_properties.data.Unit;
import b_and_b_properties.data.Property;
import b_and_b_properties.data.Room;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.TextArea;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.DefaultListModel;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFormattedTextField;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.ListSelectionModel;
import javax.swing.SwingConstants;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;

/**
 *
 * @author Rob Hammonds
 * Property Detail Panel
 */
public class PropertyDetailPanel extends JPanel implements ItemListener, ActionListener, ListSelectionListener {

    /**
     *
     * @param daoObject
     * @param prop
     */
    public PropertyDetailPanel(DAO daoObject, Property prop) {
        System.out.println("PDP w/ dao, property");
        this.daoObject = daoObject;
        this.propertyObject = prop;
        pfp = new PropertyFeaturesPanel(daoObject, propertyObject);
        initComponents();
        listScroller.setPreferredSize(new Dimension(110, 330));
        ListSelectionModel listSelectionModel = roomListHolder.getSelectionModel();
        listSelectionModel.addListSelectionListener(this);
        createTopLeft();
        createTenantOwnerPanel();
        createHouseInfoPanel();
        createRoomPanel();
        createTopRight();
        createRoomInfoPanel();
        createBottomLeft();
        createBottomRight();
        createEntryRoom();
        createDiningRoom();
        createLivingRoom();
        createMasterBedroom();
        createStudy();
        createKitchen();
        createFamilyRoom();
        setLayout(new GridLayout(2, 4, 10, 10));
        add(topLeft);
        add(topRight);
        add(bottomLeft);
        add(bottomRight);
        bdrmComboBox.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                saveNeeded = true;
            }
        });
        bathComboBox.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                saveNeeded = true;
            }
        });
        lotSizeTextField.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                try {
                    int lot = Integer.parseInt(lotSizeTextField.getText());
                    propertyObject.setLotsize(lot);
                } catch (Exception ex) {
                    JOptionPane.showMessageDialog(null, "Lot Size must be a number");
                }
                saveNeeded = true;
            }
        });
        listDateTextField.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                try {
                    Date date = new Date(listDateTextField.getText());
                } catch (Exception ex) {
                }
                saveNeeded = true;
            }
        });
        tenantNameTextField.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                propertyObject.setOwner(tenantNameTextField.getText());
                saveNeeded = true;
            }
        });
        numberOfRoomsTextField.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                unitObject.setNumberofrooms(Integer.parseInt(numberOfRoomsTextField.getText()));
                saveNeeded = true;
            }
        });
        numberOfFireplacesTextField.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                unitObject.setNumberoffireplaces(Integer.parseInt(numberOfFireplacesTextField.getText()));
                saveNeeded = true;
            }
        });
        garageSpacesComboBox.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                saveNeeded = true;
            }
        });
        heatPaidComboBox.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                saveNeeded = true;

            }
        });
        waterPaidComboBox.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                saveNeeded = true;
            }
        });
        airConditionYesNoComboBox.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                saveNeeded = true;
            }
        });
        diningRoomYesNoComboBox.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                saveNeeded = true;
            }
        });
        disabilityAccessYesNoComboBox.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                saveNeeded = true;
            }
        });
        familyRoomYesNoComboBox.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                saveNeeded = true;
            }
        });
        firstFloorBathroomYesNoComboBox.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                saveNeeded = true;
            }
        });
        firstFloorBdrmYesNoComboBox.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                saveNeeded = true;
            }
        });
        separateFurnaceYesNoComboBox.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                saveNeeded = true;
            }
        });
        separateGasYesNoComboBox.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                saveNeeded = true;
            }
        });

    }

    /**
     * Set the new unit for the unitObject
     * @param x Unit number
     */
    protected void newUnit(int x) {
        this.unitObject = new Unit();
        this.currentUnit = x;
        this.unitObject.setUnitid(x);
    }

    /**
     *  Constructor for the property detail panel
     * @param daoObject The DAO from the JTabbedPane
     * @param prop The property object from the JTabbedPane
     * @param oldProp A boolean stating whether this is an old property or not
     */
    public PropertyDetailPanel(DAO daoObject, Property prop, boolean oldProp) {
        this(daoObject, prop);
        pfp = new PropertyFeaturesPanel(daoObject, propertyObject, oldProp);
        setCheckBoxes();
        setOtherFields();
    }

    /**
     * Getting a property entry panel object
     * @param pep
     */
    public void setPEP(PropertyEntryPanel pep) {
        this.pep = pep;
    }

    private void clearUnitCheckBoxes() {
        heatPaidComboBox.setSelectedIndex(0);
        waterPaidComboBox.setSelectedIndex(0);
        separateFurnaceYesNoComboBox.setSelectedIndex(0);
        airConditionYesNoComboBox.setSelectedIndex(0);
        separateGasYesNoComboBox.setSelectedIndex(0);
        disabilityAccessYesNoComboBox.setSelectedIndex(0);
        firstFloorBdrmYesNoComboBox.setSelectedIndex(0);
        firstFloorBathroomYesNoComboBox.setSelectedIndex(0);
        familyRoomYesNoComboBox.setSelectedIndex(0);
        diningRoomYesNoComboBox.setSelectedIndex(0);
        garageSpacesComboBox.setSelectedIndex(0);
    }

    private void clearRooms() {
        entryCheckBox.setSelected(false);
        livingRoomCheckBox.setSelected(false);
        diningRoomCheckBox.setSelected(false);
        kitchenCheckBox.setSelected(false);
        breakfastCheckBox.setSelected(false);
        familyRoomCheckBox.setSelected(false);
        studyCheckBox.setSelected(false);
        recRoomCheckBox.setSelected(false);
        laundryRoomCheckBox.setSelected(false);
        roomListHolder.removeAll();
        bathAdjoinsMasterBedroomCkBox.setSelected(false);
        bookcaseEntryCkBox.setSelected(false);
        bookcaseFamilyRoomCkBox.setSelected(false);
        bookcaseLivingRoomCkBox.setSelected(false);
        bookcaseStudyCkBox.setSelected(false);
        builtInsDiningRoomCkBox.setSelected(false);
        ceramicTileKitchenCkBox.setSelected(false);
        chairRailDiningRoomCkBox.setSelected(false);
        chandelierDiningRoomCkBox.setSelected(false);
        closetEntryCkBox.setSelected(false);
        closetStudyCkBox.setSelected(false);
        counterBarKitchenCkBox.setSelected(false);
        countryKitchenCkBox.setSelected(false);
        doubleDoorsEntryCkBox.setSelected(false);
        doubleDoorsLivingRoomCkBox.setSelected(false);
        dressAreaMasterBedroomCkBox.setSelected(false);
        dryBarFamilyRoomCkBox.setSelected(false);
        dryBarLivingRoomCkBox.setSelected(false);
        eatInKitchenCkBox.setSelected(false);
        firePlaceMasterBedroomCkBox.setSelected(false);
        firePlaceEntryCkBox.setSelected(false);
        firePlaceFamilyRoomCkBox.setSelected(false);
        firePlaceDiningRoomCkBox.setSelected(false);
        firePlaceLivingRoomCkBox.setSelected(false);
        firePlaceKitchenCkBox.setSelected(false);
        firePlaceStudyCkBox.setSelected(false);
        frenchDoorsEntryCkBox.setSelected(false);
        frenchDoorsFamilyRoomCkBox.setSelected(false);
        frenchDoorsDiningRoomCkBox.setSelected(false);
        frenchDoorsStudyCkBox.setSelected(false);
        galleyKitchenCkBox.setSelected(false);
        gourmetKitchenCkBox.setSelected(false);
        islandKitchenCkBox.setSelected(false);
        laminateFloorEntryCkBox.setSelected(false);
        laminateFloorFamilyRoomCkBox.setSelected(false);
        laminateFloorDiningRoomCkBox.setSelected(false);
        laminateFloorLivingRoomCkBox.setSelected(false);
        laminateFloorKitchenCkBox.setSelected(false);
        laminateFloorStudyCkBox.setSelected(false);
        stoneCounterKitchenCkBox.setSelected(false);
        foyerEntryCkBox.setSelected(false);
        panelWallsFamilyRoomCkBox.setSelected(false);
        pantryKitchenCkBox.setSelected(false);
        sittingRoomMasterBedroomCkBox.setSelected(false);
        skyLightMasterBedroomCkBox.setSelected(false);
        skylightFamilyRoomCkBox.setSelected(false);
        skylightLivingRoomCkBox.setSelected(false);
        solidSurfaceKitchenCkBox.setSelected(false);
        vaultedCeilingMasterBedroomCkBox.setSelected(false);
        vinylFloorEntryCkBox.setSelected(false);
        vinylFloorKitchenCkBox.setSelected(false);
        closetMasterBedroomCkBox.setSelected(false);
        walkoutMasterBedroomCkBox.setSelected(false);
        walkoutEntryCkBox.setSelected(false);
        walkoutFamilyRoomCkBox.setSelected(false);
        walkoutDiningRoomCkBox.setSelected(false);
        walkoutLivingRoomCkBox.setSelected(false);
        walkoutStudyCkBox.setSelected(false);
        wetBarLivingRoomCkBox.setSelected(false);
        windowTreatMasterBedroomCkBox.setSelected(false);
        windowTreatEntryCkBox.setSelected(false);
        windowTreatFamilyRoomCkBox.setSelected(false);
        windowTreatDiningRoomCkBox.setSelected(false);
        windowTreatLivingRoomCkBox.setSelected(false);
        windowTreatKitchenCkBox.setSelected(false);
        windowTreatStudyCkBox.setSelected(false);
        woodCabinetsKitchenCkBox.setSelected(false);
        woodFloorMasterBedroomCkBox.setSelected(false);
        woodFloorEntryCkBox.setSelected(false);
        woodFloorFamilyRoomCkBox.setSelected(false);
        woodFloorDiningRoomCkBox.setSelected(false);
        woodFloorLivingRoomCkBox.setSelected(false);
        woodFloorKitchenCkBox.setSelected(false);
        woodFloorStudyCkBox.setSelected(false);
        wwCarpetMasterBedroomCkBox.setSelected(false);
        wwCarpetFamilyRoomCkBox.setSelected(false);
        wwCarpetDiningRoomCkBox.setSelected(false);
        wwCarpetLivingRoomCkBox.setSelected(false);
        wwCarpetStudyCkBox.setSelected(false);

    }

    private void clearUnitTextFields() {
        bdrmComboBox.setSelectedIndex(0);
        bathComboBox.setSelectedIndex(0);
        listDateTextField.setText(null);
        numberOfRoomsTextField.setText(null);
        numberOfFireplacesTextField.setText(null);
        garageSpacesComboBox.setSelectedIndex(0);
        tenantNameTextField.setText(null);
    }

    /**
     * Getting the unit from the property object by the index of the unit object
     * @param x int of the unit index
     * @param oldProp whether we need to call loadData
     */
    public void setUnit(int x, boolean oldProp) {
        int oldCurrent = this.currentUnit;
        this.currentUnit = x;
        System.out.println("Current" + currentUnit + "  oldCurrent" + oldCurrent);
        if (oldCurrent > -1) {
            saveUnit();
            System.out.println("past save");
            this.currentUnit = x;
            if (!oldProp) {
                System.out.println("in if");
                this.unitObject = propertyObject.getUnit(x);
                clearUnitCheckBoxes();
                clearUnitTextFields();
                clearRooms();
                this.pfp = new PropertyFeaturesPanel(this.daoObject, this.propertyObject);
            } else {
                System.out.println("in else");
                this.unitObject = propertyObject.getUnit(x);
                setCheckBoxes();
                setOtherFields();
            }
        }
    }

    /**
     * Gets the current unit in this object
     * @param index index of the unit to return
     * @return UnitObject
     */
    public Unit getUnit(int index) {
        return this.unitObject;
    }

    /**
     * Returns this property Object
     * @return property Object
     */
    public Property getProperty() {
        saveFunction();
        return this.propertyObject;
    }

    /**
     * Creates the top left panel of the Layout
     *
     */
    private void createTopLeft() {
        topLeft.setLayout(new GridLayout(6, 2));
        topLeft.add(bdrmLabel);
        bdrmComboBox.setSelectedIndex(0);
        topLeft.add(bdrmComboBox);
        topLeft.add(bathLabel);
        topLeft.add(bathComboBox);
        topLeft.add(lotSizeLabel);
        topLeft.add(lotSizeTextField);
        topLeft.add(yearBuiltLabel);
        topLeft.add(yearBuiltTextField);
        topLeft.add(listDateLabel);
        topLeft.add(listDateTextField);
        topLeft.add(tenantNameLabel);
        topLeft.add(tenantNameTextField);


    }

    /**
     * Creates the Top Right Panel for the frame
     */
    private void createTopRight() {
        topRight.setLayout(new BorderLayout(2, 2));
        topRight.add(houseInfoPanel, BorderLayout.NORTH);
        topRight.add(tenantOwnerPanel, BorderLayout.WEST);
        topRight.add(roomInfoPanel, BorderLayout.EAST);


    }

    /** 
     * Displays the Bottom Right Panel showing the 
     * check boxes for the possible rooms
     */
    private void createBottomRight() {
        bottomRight.setLayout(new BorderLayout());
        bottomRight.add(roomPanel, BorderLayout.CENTER);


    }

    /**
     * Creates the room panel for the bottom right panel.
     */
    private void createRoomPanel() {
        roomPanel.setLayout(new BorderLayout(100, 10));
        roomPanel.add(new JLabel("Avaiable Rooms", SwingConstants.CENTER), BorderLayout.NORTH);
        JPanel roomPanel2 = new JPanel(new GridLayout(3, 3));
        entryCheckBox.addItemListener(this);
        livingRoomCheckBox.addItemListener(this);
        diningRoomCheckBox.addItemListener(this);
        kitchenCheckBox.addItemListener(this);
        breakfastCheckBox.addItemListener(this);
        familyRoomCheckBox.addItemListener(this);
        studyCheckBox.addItemListener(this);
        recRoomCheckBox.addItemListener(this);
        laundryRoomCheckBox.addItemListener(this);
        roomPanel2.add(entryCheckBox);
        roomPanel2.add(livingRoomCheckBox);
        roomPanel2.add(diningRoomCheckBox);
        roomPanel2.add(kitchenCheckBox);
        roomPanel2.add(breakfastCheckBox);
        roomPanel2.add(familyRoomCheckBox);
        roomPanel2.add(studyCheckBox);
        roomPanel2.add(recRoomCheckBox);
        roomPanel2.add(laundryRoomCheckBox);
        roomPanel.add(roomPanel2, BorderLayout.CENTER);
        roomPanel.add(pfp, BorderLayout.SOUTH);
    }

    /**
     * Creates the top right panel showing Tenant/Owner Information
     * and information and other misc. info
     */
    private void createTenantOwnerPanel() {
        tenantOwnerPanel.setLayout(new GridLayout(5, 2, 2, 2));
        tenantOwnerPanel.add(heatPaidLabel);
        tenantOwnerPanel.add(heatPaidComboBox);
        tenantOwnerPanel.add(waterPaidLabel);
        tenantOwnerPanel.add(waterPaidComboBox);
        tenantOwnerPanel.add(sepGasElectricLabel);
        tenantOwnerPanel.add(separateGasYesNoComboBox);
        tenantOwnerPanel.add(sepFurnaceLabel);
        tenantOwnerPanel.add(separateFurnaceYesNoComboBox);
        tenantOwnerPanel.add(airConSeparateLabel);
        tenantOwnerPanel.add(airConditionYesNoComboBox);
    }

    /**
     * Adds the list panel to the bottom left panel of the frame
     */
    private void createBottomLeft() {
        bottomLeft.setLayout(new BorderLayout());
        roomListHolder.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        bottomLeft.add(listScroller, BorderLayout.WEST);
    }

    /**
     * Creates the room info panel for misc. information regarding the unit 
     */
    private void createRoomInfoPanel() {
        roomInfoPanel.setLayout(new GridLayout(5, 2, 2, 2));
        roomInfoPanel.add(disabilityAccessLabel);
        roomInfoPanel.add(disabilityAccessYesNoComboBox);
        roomInfoPanel.add(new JLabel("First Floor Bedroom"));
        roomInfoPanel.add(firstFloorBdrmYesNoComboBox);
        roomInfoPanel.add(new JLabel("First Floor Bathroom"));
        roomInfoPanel.add(firstFloorBathroomYesNoComboBox);
        roomInfoPanel.add(new JLabel("Family Room"));
        roomInfoPanel.add(familyRoomYesNoComboBox);
        roomInfoPanel.add(new JLabel("Formal Dining Room"));
        roomInfoPanel.add(diningRoomYesNoComboBox);
    }

    /**
     * Creates the house panel which allows input of basic information for 
     * the house. 
     */
    private void createHouseInfoPanel() {
        houseInfoPanel.setLayout(new GridLayout(3, 2));
        houseInfoPanel.add(numberOfRoomsLabel);
        houseInfoPanel.add(numberOfRoomsTextField);
        houseInfoPanel.add(numberOfFireplacesLabel);
        houseInfoPanel.add(numberOfFireplacesTextField);
        houseInfoPanel.add(garageSpacesLabel);
        houseInfoPanel.add(garageSpacesComboBox);
    }

    /**
     * Master Bedroom Panel which displays in the bottom left when 
     * the Master Bedroom item is selected from the JList
     */
    private void createMasterBedroom() {
        dimOfMasterBedroom.add(masterBedroomWidth);
        dimOfMasterBedroom.add(new JLabel("x", SwingConstants.CENTER));
        dimOfMasterBedroom.add(masterBedroomLength);
        masterBedroomListPanel.setLayout(new BorderLayout(2, 2));
        JPanel masterBedroomCheckPanel = new JPanel(new GridLayout(13, 2));
        masterBedroomCheckPanel.add(woodFloorMasterBedroomCkBox);
        masterBedroomCheckPanel.add(wwCarpetMasterBedroomCkBox);
        masterBedroomCheckPanel.add(bathAdjoinsMasterBedroomCkBox);
        masterBedroomCheckPanel.add(firePlaceMasterBedroomCkBox);
        masterBedroomCheckPanel.add(walkoutMasterBedroomCkBox);
        masterBedroomCheckPanel.add(windowTreatMasterBedroomCkBox);
        masterBedroomCheckPanel.add(sittingRoomMasterBedroomCkBox);
        masterBedroomCheckPanel.add(skyLightMasterBedroomCkBox);
        masterBedroomCheckPanel.add(closetMasterBedroomCkBox);
        masterBedroomCheckPanel.add(dressAreaMasterBedroomCkBox);
        masterBedroomCheckPanel.add(commentMasterBedroomLabel);
        masterBedroomCheckPanel.add(vaultedCeilingMasterBedroomCkBox);
        masterBedroomCheckPanel.add(masterBedroomCommentTextArea);
        masterBedroomCheckPanel.add(new JLabel());
        masterBedroomCheckPanel.add(new JLabel("Room Dimensions:", SwingConstants.CENTER));
        masterBedroomCheckPanel.add(dimOfMasterBedroom);
        masterBedroomListPanel.add(new JLabel("Master Bedroom", SwingConstants.CENTER), BorderLayout.NORTH);
        masterBedroomListPanel.add(masterBedroomCheckPanel, BorderLayout.CENTER);
        woodFloorMasterBedroomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (woodFloorMasterBedroomCkBox.isSelected()) {
                    masterBedroomCBConverter.set(CheckBoxConverter.BOX1);
                } else {
                    masterBedroomCBConverter.clear(CheckBoxConverter.BOX1);
                }
            }
        });
        skyLightMasterBedroomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (skyLightMasterBedroomCkBox.isSelected()) {
                    masterBedroomCBConverter.set(CheckBoxConverter.BOX2);
                } else {
                    masterBedroomCBConverter.clear(CheckBoxConverter.BOX2);
                }
            }
        });
        sittingRoomMasterBedroomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (sittingRoomMasterBedroomCkBox.isSelected()) {
                    masterBedroomCBConverter.set(CheckBoxConverter.BOX3);
                } else {
                    masterBedroomCBConverter.clear(CheckBoxConverter.BOX3);
                }
            }
        });
        wwCarpetMasterBedroomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (wwCarpetMasterBedroomCkBox.isSelected()) {
                    masterBedroomCBConverter.set(CheckBoxConverter.BOX4);
                } else {
                    masterBedroomCBConverter.clear(CheckBoxConverter.BOX4);
                }
            }
        });
        firePlaceMasterBedroomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (firePlaceMasterBedroomCkBox.isSelected()) {
                    masterBedroomCBConverter.set(CheckBoxConverter.BOX5);
                } else {
                    masterBedroomCBConverter.clear(CheckBoxConverter.BOX5);
                }
            }
        });
        closetMasterBedroomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (closetMasterBedroomCkBox.isSelected()) {
                    masterBedroomCBConverter.set(CheckBoxConverter.BOX5);
                } else {
                    masterBedroomCBConverter.clear(CheckBoxConverter.BOX5);
                }
            }
        });
        bathAdjoinsMasterBedroomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (bathAdjoinsMasterBedroomCkBox.isSelected()) {
                    masterBedroomCBConverter.set(CheckBoxConverter.BOX6);
                } else {
                    masterBedroomCBConverter.clear(CheckBoxConverter.BOX6);
                }
            }
        });
        walkoutMasterBedroomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (walkoutMasterBedroomCkBox.isSelected()) {
                    masterBedroomCBConverter.set(CheckBoxConverter.BOX7);
                } else {
                    masterBedroomCBConverter.clear(CheckBoxConverter.BOX7);
                }
            }
        });
        windowTreatMasterBedroomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (windowTreatMasterBedroomCkBox.isSelected()) {
                    masterBedroomCBConverter.set(CheckBoxConverter.BOX8);
                } else {
                    masterBedroomCBConverter.clear(CheckBoxConverter.BOX8);
                }
            }
        });
        vaultedCeilingMasterBedroomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (vaultedCeilingMasterBedroomCkBox.isSelected()) {
                    masterBedroomCBConverter.set(CheckBoxConverter.BOX9);
                } else {
                    masterBedroomCBConverter.clear(CheckBoxConverter.BOX9);
                }
            }
        });


    }

    /**
     * Creates the panel for the Family Room when it is selected from
     * the JList
     */
    private void createFamilyRoom() {

        familyRoomListPanel.setLayout(new BorderLayout(2, 2));
        JPanel familyRoomCheckPanel = new JPanel(new GridLayout(13, 2));
        familyRoomCheckPanel.add(woodFloorFamilyRoomCkBox);
        familyRoomCheckPanel.add(laminateFloorFamilyRoomCkBox);
        familyRoomCheckPanel.add(wwCarpetFamilyRoomCkBox);
        familyRoomCheckPanel.add(firePlaceFamilyRoomCkBox);
        familyRoomCheckPanel.add(walkoutFamilyRoomCkBox);
        familyRoomCheckPanel.add(windowTreatFamilyRoomCkBox);
        familyRoomCheckPanel.add(bookcaseFamilyRoomCkBox);
        familyRoomCheckPanel.add(frenchDoorsFamilyRoomCkBox);
        familyRoomCheckPanel.add(panelWallsFamilyRoomCkBox);
        familyRoomCheckPanel.add(dryBarFamilyRoomCkBox);
        familyRoomCheckPanel.add(commentFamilyRoomLabel);
        familyRoomCheckPanel.add(skylightFamilyRoomCkBox);
        familyRoomCheckPanel.add(familyRoomCommentTextArea);
        familyRoomCheckPanel.add(new JLabel());
        familyRoomCheckPanel.add(new JLabel("Room Dimensions:", SwingConstants.CENTER));
        familyRoomCheckPanel.add(dimOfFamilyRoom);
        familyRoomListPanel.add(new JLabel("Family Room", SwingConstants.CENTER), BorderLayout.NORTH);
        familyRoomListPanel.add(familyRoomCheckPanel, BorderLayout.CENTER);

        woodFloorFamilyRoomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (woodFloorFamilyRoomCkBox.isSelected()) {
                    familyRoomCBConverter.set(CheckBoxConverter.BOX1);
                } else {
                    familyRoomCBConverter.clear(CheckBoxConverter.BOX1);
                }
            }
        });
        skylightFamilyRoomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (skylightFamilyRoomCkBox.isSelected()) {
                    familyRoomCBConverter.set(CheckBoxConverter.BOX2);
                } else {
                    familyRoomCBConverter.clear(CheckBoxConverter.BOX2);
                }
            }
        });
        panelWallsFamilyRoomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (panelWallsFamilyRoomCkBox.isSelected()) {
                    familyRoomCBConverter.set(CheckBoxConverter.BOX3);
                } else {
                    familyRoomCBConverter.clear(CheckBoxConverter.BOX3);
                }
            }
        });
        wwCarpetFamilyRoomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (wwCarpetFamilyRoomCkBox.isSelected()) {
                    familyRoomCBConverter.set(CheckBoxConverter.BOX4);
                } else {
                    familyRoomCBConverter.clear(CheckBoxConverter.BOX4);
                }
            }
        });
        firePlaceFamilyRoomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (firePlaceFamilyRoomCkBox.isSelected()) {
                    familyRoomCBConverter.set(CheckBoxConverter.BOX5);
                } else {
                    familyRoomCBConverter.clear(CheckBoxConverter.BOX5);
                }
            }
        });
        laminateFloorFamilyRoomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (laminateFloorFamilyRoomCkBox.isSelected()) {
                    familyRoomCBConverter.set(CheckBoxConverter.BOX6);
                } else {
                    familyRoomCBConverter.clear(CheckBoxConverter.BOX6);
                }
            }
        });
        dryBarFamilyRoomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (dryBarFamilyRoomCkBox.isSelected()) {
                    familyRoomCBConverter.set(CheckBoxConverter.BOX7);
                } else {
                    familyRoomCBConverter.clear(CheckBoxConverter.BOX7);
                }
            }
        });
        walkoutFamilyRoomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (walkoutFamilyRoomCkBox.isSelected()) {
                    familyRoomCBConverter.set(CheckBoxConverter.BOX8);
                } else {
                    familyRoomCBConverter.clear(CheckBoxConverter.BOX8);
                }
            }
        });
        windowTreatFamilyRoomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (windowTreatFamilyRoomCkBox.isSelected()) {
                    familyRoomCBConverter.set(CheckBoxConverter.BOX9);
                } else {
                    familyRoomCBConverter.clear(CheckBoxConverter.BOX9);
                }
            }
        });


    }

    /**
     * Creates the dining room panel which displays in the bottom left
     * when the Dining Room value is selected from the JList
     */
    private void createDiningRoom() {
        dimOfDiningRoom.add(DiningRoomWidth);
        dimOfDiningRoom.add(new JLabel("x", SwingConstants.CENTER));
        dimOfDiningRoom.add(DiningRoomLength);
        diningRoomListPanel.setLayout(new BorderLayout(2, 2));
        JPanel diningRoomCheckPanel = new JPanel(new GridLayout(13, 2));
        diningRoomCheckPanel.add(woodFloorDiningRoomCkBox);
        diningRoomCheckPanel.add(laminateFloorDiningRoomCkBox);
        diningRoomCheckPanel.add(wwCarpetDiningRoomCkBox);
        diningRoomCheckPanel.add(firePlaceDiningRoomCkBox);
        diningRoomCheckPanel.add(walkoutDiningRoomCkBox);
        diningRoomCheckPanel.add(windowTreatDiningRoomCkBox);
        diningRoomCheckPanel.add(chairRailDiningRoomCkBox);
        diningRoomCheckPanel.add(frenchDoorsDiningRoomCkBox);
        diningRoomCheckPanel.add(chandelierDiningRoomCkBox);
        diningRoomCheckPanel.add(builtInsDiningRoomCkBox);
        diningRoomCheckPanel.add(commentDiningRoomLabel);
        diningRoomCheckPanel.add(new JLabel());
        diningRoomCheckPanel.add(diningRoomCommentTextArea);
        diningRoomCheckPanel.add(new JLabel());
        diningRoomCheckPanel.add(new JLabel("Room Dimensions:", SwingConstants.CENTER));
        diningRoomCheckPanel.add(dimOfDiningRoom);
        diningRoomListPanel.add(new JLabel("Dining Room", SwingConstants.CENTER), BorderLayout.NORTH);
        diningRoomListPanel.add(diningRoomCheckPanel, BorderLayout.CENTER);

        woodFloorDiningRoomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (woodFloorDiningRoomCkBox.isSelected()) {
                    diningRoomCBConverter.set(CheckBoxConverter.BOX1);
                } else {
                    diningRoomCBConverter.clear(CheckBoxConverter.BOX1);
                }
            }
        });
        chandelierDiningRoomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (chandelierDiningRoomCkBox.isSelected()) {
                    diningRoomCBConverter.set(CheckBoxConverter.BOX2);
                } else {
                    diningRoomCBConverter.clear(CheckBoxConverter.BOX2);
                }
            }
        });
        chairRailDiningRoomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (chairRailDiningRoomCkBox.isSelected()) {
                    diningRoomCBConverter.set(CheckBoxConverter.BOX3);
                } else {
                    diningRoomCBConverter.clear(CheckBoxConverter.BOX3);
                }
            }
        });
        wwCarpetDiningRoomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (wwCarpetDiningRoomCkBox.isSelected()) {
                    diningRoomCBConverter.set(CheckBoxConverter.BOX4);
                } else {
                    diningRoomCBConverter.clear(CheckBoxConverter.BOX4);
                }
            }
        });
        firePlaceDiningRoomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (firePlaceDiningRoomCkBox.isSelected()) {
                    diningRoomCBConverter.set(CheckBoxConverter.BOX5);
                } else {
                    diningRoomCBConverter.clear(CheckBoxConverter.BOX5);
                }
            }
        });
        laminateFloorDiningRoomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (laminateFloorDiningRoomCkBox.isSelected()) {
                    diningRoomCBConverter.set(CheckBoxConverter.BOX5);
                } else {
                    diningRoomCBConverter.clear(CheckBoxConverter.BOX5);
                }
            }
        });
        builtInsDiningRoomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (builtInsDiningRoomCkBox.isSelected()) {
                    diningRoomCBConverter.set(CheckBoxConverter.BOX6);
                } else {
                    diningRoomCBConverter.clear(CheckBoxConverter.BOX6);
                }
            }
        });
        walkoutDiningRoomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (walkoutDiningRoomCkBox.isSelected()) {
                    diningRoomCBConverter.set(CheckBoxConverter.BOX7);
                } else {
                    diningRoomCBConverter.clear(CheckBoxConverter.BOX7);
                }
            }
        });
        windowTreatDiningRoomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (windowTreatDiningRoomCkBox.isSelected()) {
                    diningRoomCBConverter.set(CheckBoxConverter.BOX8);
                } else {
                    diningRoomCBConverter.clear(CheckBoxConverter.BOX8);
                }
            }
        });
    }

    /**
     * Creates the Living room panel which displays in the bottom left
     * when the Living Room value is selected from the JList
     */
    private void createLivingRoom() {

        JPanel dimOfLivingRoom = new JPanel(new GridLayout(1, 3));
        dimOfLivingRoom.add(livingRoomWidth);
        dimOfLivingRoom.add(new JLabel("x", SwingConstants.CENTER));
        dimOfLivingRoom.add(livingRoomLength);

        livingRoomListPanel.setLayout(new BorderLayout(2, 2));
        JPanel livingRoomCheckPanel = new JPanel(new GridLayout(13, 2));
        livingRoomCheckPanel.add(woodFloorLivingRoomCkBox);
        livingRoomCheckPanel.add(laminateFloorLivingRoomCkBox);
        livingRoomCheckPanel.add(wwCarpetLivingRoomCkBox);
        livingRoomCheckPanel.add(firePlaceLivingRoomCkBox);
        livingRoomCheckPanel.add(walkoutLivingRoomCkBox);
        livingRoomCheckPanel.add(windowTreatLivingRoomCkBox);
        livingRoomCheckPanel.add(bookcaseLivingRoomCkBox);
        livingRoomCheckPanel.add(skylightLivingRoomCkBox);
        livingRoomCheckPanel.add(wetBarLivingRoomCkBox);
        livingRoomCheckPanel.add(dryBarLivingRoomCkBox);
        livingRoomCheckPanel.add(commentLivingRoomLabel);
        livingRoomCheckPanel.add(doubleDoorsLivingRoomCkBox);
        livingRoomCheckPanel.add(livingRoomCommentTextArea);
        livingRoomCheckPanel.add(new JLabel());
        livingRoomCheckPanel.add(new JLabel("Room Dimensions:", SwingConstants.CENTER));
        livingRoomCheckPanel.add(dimOfLivingRoom);
        livingRoomListPanel.add(new JLabel("Living Room", SwingConstants.CENTER), BorderLayout.NORTH);
        livingRoomListPanel.add(livingRoomCheckPanel, BorderLayout.CENTER);
        woodFloorLivingRoomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (woodFloorLivingRoomCkBox.isSelected()) {
                    livingRoomCBConverter.set(CheckBoxConverter.BOX1);
                } else {
                    livingRoomCBConverter.clear(CheckBoxConverter.BOX1);
                }
            }
        });
        wetBarLivingRoomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (wetBarLivingRoomCkBox.isSelected()) {
                    livingRoomCBConverter.set(CheckBoxConverter.BOX2);
                } else {
                    livingRoomCBConverter.clear(CheckBoxConverter.BOX2);
                }
            }
        });
        bookcaseLivingRoomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (bookcaseLivingRoomCkBox.isSelected()) {
                    livingRoomCBConverter.set(CheckBoxConverter.BOX3);
                } else {
                    livingRoomCBConverter.clear(CheckBoxConverter.BOX3);
                }
            }
        });
        skylightLivingRoomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (skylightLivingRoomCkBox.isSelected()) {
                    livingRoomCBConverter.set(CheckBoxConverter.BOX4);
                } else {
                    livingRoomCBConverter.clear(CheckBoxConverter.BOX4);
                }
            }
        });
        wwCarpetLivingRoomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (wwCarpetLivingRoomCkBox.isSelected()) {
                    livingRoomCBConverter.set(CheckBoxConverter.BOX5);
                } else {
                    livingRoomCBConverter.clear(CheckBoxConverter.BOX5);
                }
            }
        });
        firePlaceLivingRoomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (firePlaceLivingRoomCkBox.isSelected()) {
                    livingRoomCBConverter.set(CheckBoxConverter.BOX6);
                } else {
                    livingRoomCBConverter.clear(CheckBoxConverter.BOX6);
                }
            }
        });
        laminateFloorLivingRoomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (laminateFloorLivingRoomCkBox.isSelected()) {
                    livingRoomCBConverter.set(CheckBoxConverter.BOX7);
                } else {
                    livingRoomCBConverter.clear(CheckBoxConverter.BOX7);
                }
            }
        });
        dryBarLivingRoomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (dryBarLivingRoomCkBox.isSelected()) {
                    livingRoomCBConverter.set(CheckBoxConverter.BOX8);
                } else {
                    livingRoomCBConverter.clear(CheckBoxConverter.BOX8);
                }
            }
        });
        walkoutLivingRoomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                if (walkoutLivingRoomCkBox.isSelected()) {
                    saveNeeded = true;
                    livingRoomCBConverter.set(CheckBoxConverter.BOX9);
                } else {
                    livingRoomCBConverter.clear(CheckBoxConverter.BOX9);
                }
            }
        });
        windowTreatLivingRoomCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (windowTreatLivingRoomCkBox.isSelected()) {
                    livingRoomCBConverter.set(CheckBoxConverter.BOX10);
                } else {
                    livingRoomCBConverter.clear(CheckBoxConverter.BOX10);
                }
            }
        });


    }

    /**
     * Creates the Study panel which displays in the bottom left
     * when the Study value is selected from the JList
     */
    private void createStudy() {

        dimOfStudy.add(studyWidth);
        dimOfStudy.add(new JLabel("x", SwingConstants.CENTER));
        dimOfStudy.add(studyLength);
        studyListPanel.setLayout(new BorderLayout(2, 2));
        JPanel studyCheckPanel = new JPanel(new GridLayout(12, 2));
        studyCheckPanel.add(woodFloorStudyCkBox);
        studyCheckPanel.add(laminateFloorStudyCkBox);
        studyCheckPanel.add(wwCarpetStudyCkBox);
        studyCheckPanel.add(firePlaceStudyCkBox);
        studyCheckPanel.add(walkoutStudyCkBox);
        studyCheckPanel.add(windowTreatStudyCkBox);
        studyCheckPanel.add(bookcaseStudyCkBox);
        studyCheckPanel.add(frenchDoorsStudyCkBox);
        studyCheckPanel.add(closetStudyCkBox);
        studyCheckPanel.add(commentStudyLabel);
        studyCheckPanel.add(new JLabel());
        studyCheckPanel.add(studyCommentTextArea);
        studyCheckPanel.add(new JLabel());
        studyCheckPanel.add(new JLabel("Room Dimensions:", SwingConstants.CENTER));
        studyCheckPanel.add(dimOfStudy);
        studyListPanel.add(new JLabel("Study", SwingConstants.CENTER), BorderLayout.NORTH);
        studyListPanel.add(studyCheckPanel, BorderLayout.CENTER);

        woodFloorStudyCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (woodFloorStudyCkBox.isSelected()) {
                    studyCBConverter.set(CheckBoxConverter.BOX1);
                } else {
                    studyCBConverter.clear(CheckBoxConverter.BOX1);
                }
            }
        });
        bookcaseStudyCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (bookcaseStudyCkBox.isSelected()) {
                    studyCBConverter.set(CheckBoxConverter.BOX2);
                } else {
                    studyCBConverter.clear(CheckBoxConverter.BOX2);
                }
            }
        });
        closetStudyCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (closetStudyCkBox.isSelected()) {
                    studyCBConverter.set(CheckBoxConverter.BOX3);
                } else {
                    studyCBConverter.clear(CheckBoxConverter.BOX3);
                }
            }
        });
        wwCarpetStudyCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (wwCarpetStudyCkBox.isSelected()) {
                    studyCBConverter.set(CheckBoxConverter.BOX4);
                } else {
                    studyCBConverter.clear(CheckBoxConverter.BOX4);
                }
            }
        });
        firePlaceStudyCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (firePlaceStudyCkBox.isSelected()) {
                    studyCBConverter.set(CheckBoxConverter.BOX5);
                } else {
                    studyCBConverter.clear(CheckBoxConverter.BOX5);
                }
            }
        });
        laminateFloorStudyCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (laminateFloorStudyCkBox.isSelected()) {
                    studyCBConverter.set(CheckBoxConverter.BOX6);
                } else {
                    studyCBConverter.clear(CheckBoxConverter.BOX6);
                }
            }
        });
        frenchDoorsStudyCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (frenchDoorsStudyCkBox.isSelected()) {
                    studyCBConverter.set(CheckBoxConverter.BOX7);
                } else {
                    studyCBConverter.clear(CheckBoxConverter.BOX7);
                }
            }
        });
        walkoutStudyCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (walkoutStudyCkBox.isSelected()) {
                    studyCBConverter.set(CheckBoxConverter.BOX8);
                } else {
                    studyCBConverter.clear(CheckBoxConverter.BOX8);
                }
            }
        });
        windowTreatStudyCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (windowTreatStudyCkBox.isSelected()) {
                    studyCBConverter.set(CheckBoxConverter.BOX9);
                } else {
                    studyCBConverter.clear(CheckBoxConverter.BOX9);
                }
            }
        });


    }

    /**
     * Creates the Kitchen panel which displays in the bottom left
     * when the Kitchen value is selected from the JList
     */
    private void createKitchen() {

        dimOfKitchen.add(kitchenWidth);
        dimOfKitchen.add(new JLabel("x", SwingConstants.CENTER));
        dimOfKitchen.add(kitchenLength);

        kitchenListPanel.setLayout(new BorderLayout(2, 2));
        JPanel kitchenCheckPanel = new JPanel(new GridLayout(16, 2));
        kitchenCheckPanel.add(woodFloorKitchenCkBox);
        kitchenCheckPanel.add(laminateFloorKitchenCkBox);
        kitchenCheckPanel.add(vinylFloorKitchenCkBox);
        kitchenCheckPanel.add(firePlaceKitchenCkBox);
        kitchenCheckPanel.add(stoneCounterKitchenCkBox);
        kitchenCheckPanel.add(windowTreatKitchenCkBox);
        kitchenCheckPanel.add(ceramicTileKitchenCkBox);
        kitchenCheckPanel.add(eatInKitchenCkBox);
        kitchenCheckPanel.add(gourmetKitchenCkBox);
        kitchenCheckPanel.add(countryKitchenCkBox);
        kitchenCheckPanel.add(counterBarKitchenCkBox);
        kitchenCheckPanel.add(galleyKitchenCkBox);
        kitchenCheckPanel.add(woodCabinetsKitchenCkBox);
        kitchenCheckPanel.add(pantryKitchenCkBox);
        kitchenCheckPanel.add(islandKitchenCkBox);
        kitchenCheckPanel.add(commentKitchenLabel);
        kitchenCheckPanel.add(solidSurfaceKitchenCkBox);
        kitchenCheckPanel.add(KitchenCommentTextArea);
        kitchenCheckPanel.add(new JLabel("Room Dimensions:", SwingConstants.CENTER));
        kitchenCheckPanel.add(dimOfKitchen);
        kitchenListPanel.add(new JLabel("Kitchen ", SwingConstants.CENTER), BorderLayout.NORTH);
        kitchenListPanel.add(kitchenCheckPanel, BorderLayout.CENTER);

        woodFloorKitchenCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (woodFloorKitchenCkBox.isSelected()) {
                    kitchenCBConverter.set(CheckBoxConverter.BOX1);
                } else {
                    kitchenCBConverter.clear(CheckBoxConverter.BOX1);
                }
            }
        });
        ceramicTileKitchenCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (ceramicTileKitchenCkBox.isSelected()) {
                    kitchenCBConverter.set(CheckBoxConverter.BOX2);
                } else {
                    kitchenCBConverter.clear(CheckBoxConverter.BOX2);
                }
            }
        });
        counterBarKitchenCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (counterBarKitchenCkBox.isSelected()) {
                    kitchenCBConverter.set(CheckBoxConverter.BOX3);
                } else {
                    kitchenCBConverter.clear(CheckBoxConverter.BOX3);
                }
            }
        });
        countryKitchenCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (countryKitchenCkBox.isSelected()) {
                    kitchenCBConverter.set(CheckBoxConverter.BOX4);
                } else {
                    kitchenCBConverter.clear(CheckBoxConverter.BOX4);
                }
            }
        });
        firePlaceKitchenCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (firePlaceKitchenCkBox.isSelected()) {
                    kitchenCBConverter.set(CheckBoxConverter.BOX5);
                } else {
                    kitchenCBConverter.clear(CheckBoxConverter.BOX5);
                }
            }
        });
        eatInKitchenCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (eatInKitchenCkBox.isSelected()) {
                    kitchenCBConverter.set(CheckBoxConverter.BOX6);
                } else {
                    kitchenCBConverter.clear(CheckBoxConverter.BOX6);
                }
            }
        });
        galleyKitchenCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (galleyKitchenCkBox.isSelected()) {
                    kitchenCBConverter.set(CheckBoxConverter.BOX7);
                } else {
                    kitchenCBConverter.clear(CheckBoxConverter.BOX7);
                }
            }
        });
        laminateFloorKitchenCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (laminateFloorKitchenCkBox.isSelected()) {
                    kitchenCBConverter.set(CheckBoxConverter.BOX8);
                } else {
                    kitchenCBConverter.clear(CheckBoxConverter.BOX8);
                }
            }
        });
        vinylFloorKitchenCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (vinylFloorKitchenCkBox.isSelected()) {
                    kitchenCBConverter.set(CheckBoxConverter.BOX9);
                } else {
                    kitchenCBConverter.clear(CheckBoxConverter.BOX9);
                }
            }
        });
        islandKitchenCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (islandKitchenCkBox.isSelected()) {
                    kitchenCBConverter.set(CheckBoxConverter.BOX10);
                } else {
                    kitchenCBConverter.clear(CheckBoxConverter.BOX10);
                }
            }
        });
        solidSurfaceKitchenCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (solidSurfaceKitchenCkBox.isSelected()) {
                    kitchenCBConverter.set(CheckBoxConverter.BOX11);
                } else {
                    kitchenCBConverter.clear(CheckBoxConverter.BOX11);
                }
            }
        });
        stoneCounterKitchenCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (stoneCounterKitchenCkBox.isSelected()) {
                    kitchenCBConverter.set(CheckBoxConverter.BOX12);
                } else {
                    kitchenCBConverter.clear(CheckBoxConverter.BOX12);
                }
            }
        });
        woodCabinetsKitchenCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (woodCabinetsKitchenCkBox.isSelected()) {
                    kitchenCBConverter.set(CheckBoxConverter.BOX13);
                } else {
                    kitchenCBConverter.clear(CheckBoxConverter.BOX13);
                }
            }
        });
        windowTreatKitchenCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (windowTreatKitchenCkBox.isSelected()) {
                    kitchenCBConverter.set(CheckBoxConverter.BOX14);
                } else {
                    kitchenCBConverter.clear(CheckBoxConverter.BOX14);
                }
            }
        });
        pantryKitchenCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                if (pantryKitchenCkBox.isSelected()) {
                    kitchenCBConverter.set(CheckBoxConverter.BOX15);
                } else {
                    kitchenCBConverter.clear(CheckBoxConverter.BOX15);
                }
            }
        });


    }

    /**
     * Creates the Entry panel which displays in the bottom left
     * when the Entry value is selected from the JList
     */
    private void createEntryRoom() {

        dimOfEntryRoom.add(entryRoomWidth);
        dimOfEntryRoom.add(new JLabel("x", SwingConstants.CENTER));
        dimOfEntryRoom.add(entryRoomLength);

        entryListPanel.setLayout(new BorderLayout(2, 2));
        JPanel entryCheckPanel = new JPanel(new GridLayout(13, 2));
        entryCheckPanel.add(woodFloorEntryCkBox);
        entryCheckPanel.add(laminateFloorEntryCkBox);
        entryCheckPanel.add(vinylFloorEntryCkBox);
        entryCheckPanel.add(firePlaceEntryCkBox);
        entryCheckPanel.add(walkoutEntryCkBox);
        entryCheckPanel.add(windowTreatEntryCkBox);
        entryCheckPanel.add(bookcaseEntryCkBox);
        entryCheckPanel.add(frenchDoorsEntryCkBox);
        entryCheckPanel.add(closetEntryCkBox);
        entryCheckPanel.add(foyerEntryCkBox);
        entryCheckPanel.add(commentEntryLabel);
        entryCheckPanel.add(doubleDoorsEntryCkBox);
        entryCheckPanel.add(entryCommentTextArea);
        entryCheckPanel.add(new JLabel());
        entryCheckPanel.add(new JLabel("Room Dimensions:", SwingConstants.CENTER));
        entryCheckPanel.add(dimOfEntryRoom);
        entryListPanel.add(new JLabel("Entry Room", SwingConstants.CENTER), BorderLayout.NORTH);
        entryListPanel.add(entryCheckPanel, BorderLayout.EAST);

        woodFloorEntryCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                saveNeeded = true;
                if (woodFloorEntryCkBox.isSelected()) {
                    entryRoomCBConverter.set(CheckBoxConverter.BOX1);
                } else {
                    entryRoomCBConverter.clear(CheckBoxConverter.BOX1);
                }
            }
        });
        bookcaseEntryCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                saveNeeded = true;
                if (bookcaseEntryCkBox.isSelected()) {
                    entryRoomCBConverter.set(CheckBoxConverter.BOX2);
                } else {
                    entryRoomCBConverter.clear(CheckBoxConverter.BOX2);
                }
            }
        });
        closetEntryCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                saveNeeded = true;
                if (closetEntryCkBox.isSelected()) {
                    entryRoomCBConverter.set(CheckBoxConverter.BOX3);
                } else {
                    entryRoomCBConverter.clear(CheckBoxConverter.BOX3);
                }
            }
        });
        doubleDoorsEntryCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                saveNeeded = true;
                if (doubleDoorsEntryCkBox.isSelected()) {
                    entryRoomCBConverter.set(CheckBoxConverter.BOX4);
                } else {
                    entryRoomCBConverter.clear(CheckBoxConverter.BOX4);
                }
            }
        });
        firePlaceEntryCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                saveNeeded = true;
                if (firePlaceEntryCkBox.isSelected()) {
                    entryRoomCBConverter.set(CheckBoxConverter.BOX5);
                } else {
                    entryRoomCBConverter.clear(CheckBoxConverter.BOX5);
                }
            }
        });
        foyerEntryCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                saveNeeded = true;
                if (foyerEntryCkBox.isSelected()) {
                    entryRoomCBConverter.set(CheckBoxConverter.BOX6);
                } else {
                    entryRoomCBConverter.clear(CheckBoxConverter.BOX6);
                }
            }
        });
        frenchDoorsEntryCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                saveNeeded = true;
                if (frenchDoorsEntryCkBox.isSelected()) {
                    entryRoomCBConverter.set(CheckBoxConverter.BOX7);
                } else {
                    entryRoomCBConverter.clear(CheckBoxConverter.BOX7);
                }
            }
        });
        laminateFloorEntryCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                saveNeeded = true;
                if (laminateFloorEntryCkBox.isSelected()) {
                    entryRoomCBConverter.set(CheckBoxConverter.BOX8);
                } else {
                    entryRoomCBConverter.clear(CheckBoxConverter.BOX8);
                }
            }
        });
        vinylFloorEntryCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                saveNeeded = true;
                if (vinylFloorEntryCkBox.isSelected()) {
                    entryRoomCBConverter.set(CheckBoxConverter.BOX9);
                } else {
                    entryRoomCBConverter.clear(CheckBoxConverter.BOX9);
                }
            }
        });
        walkoutEntryCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                saveNeeded = true;
                if (walkoutEntryCkBox.isSelected()) {
                    entryRoomCBConverter.set(CheckBoxConverter.BOX10);
                } else {
                    entryRoomCBConverter.clear(CheckBoxConverter.BOX10);
                }
            }
        });
        windowTreatEntryCkBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                saveNeeded = true;
                saveNeeded = true;
                if (windowTreatEntryCkBox.isSelected()) {
                    entryRoomCBConverter.set(CheckBoxConverter.BOX11);
                } else {
                    entryRoomCBConverter.clear(CheckBoxConverter.BOX11);
                }
            }
        });



    }

    /**
     * Add all the valueChanged listeners for all the objects
     * @param e
     */
    public void valueChanged(ListSelectionEvent e) {
        try {
            if (roomListHolder.getSelectedValue().equals("Entry Room") && entryCheckBox.isSelected()) {
                bottomLeft.removeAll();
                bottomLeft.add(listScroller, BorderLayout.WEST);
                bottomLeft.add(entryListPanel, BorderLayout.CENTER);
                this.revalidate();
                this.repaint();
            } else if (roomListHolder.getSelectedValue().equals("Entry Room") && !entryCheckBox.isSelected()) {
                roomListHolder.setSelectedIndex(0);
            }
        } catch (Exception ex) {
        }
        try {
            if (roomListHolder.getSelectedValue().equals("Kitchen") && kitchenCheckBox.isSelected()) {
                bottomLeft.removeAll();
                bottomLeft.add(listScroller, BorderLayout.WEST);
                bottomLeft.add(kitchenListPanel, BorderLayout.EAST);
                this.revalidate();
                this.repaint();
            } else if (roomListHolder.getSelectedValue().equals("Kitchen") && !kitchenCheckBox.isSelected()) {
                roomListHolder.setSelectedIndex(0);
            }
        } catch (Exception ex) {
        }
        try {
            if (roomListHolder.getSelectedValue().equals("Study") && studyCheckBox.isSelected()) {
                bottomLeft.removeAll();
                bottomLeft.add(listScroller, BorderLayout.WEST);

                bottomLeft.add(studyListPanel, BorderLayout.EAST);


                this.revalidate();


                this.repaint();


            } else if (roomListHolder.getSelectedValue().equals("Study") && !studyCheckBox.isSelected()) {
                roomListHolder.setSelectedIndex(0);


            }
        } catch (Exception ex) {
        }
        try {
            if (roomListHolder.getSelectedValue().equals("Master Bedroom")) {
                bottomLeft.removeAll();
                bottomLeft.add(listScroller, BorderLayout.WEST);

                bottomLeft.add(masterBedroomListPanel, BorderLayout.EAST);


                this.revalidate();


                this.repaint();


            }
        } catch (Exception ex) {
        }
        try {
            if (roomListHolder.getSelectedValue().equals("Living Room")) {
                bottomLeft.removeAll();
                bottomLeft.add(listScroller, BorderLayout.WEST);

                bottomLeft.add(livingRoomListPanel, BorderLayout.EAST);


                this.revalidate();


                this.repaint();


            }
        } catch (Exception ex) {
        }
        try {
            if (roomListHolder.getSelectedValue().equals("Dining Room")) {
                bottomLeft.removeAll();
                bottomLeft.add(listScroller, BorderLayout.WEST);

                bottomLeft.add(diningRoomListPanel, BorderLayout.EAST);


                this.revalidate();


                this.repaint();


            }
        } catch (Exception ex) {
        }
        try {
            if (roomListHolder.getSelectedValue().equals("Family Room")) {
                bottomLeft.removeAll();
                bottomLeft.add(listScroller, BorderLayout.WEST);

                bottomLeft.add(familyRoomListPanel, BorderLayout.EAST);


                this.revalidate();


                this.repaint();


            }
        } catch (Exception ex) {
        }
    }

    /**
     * These are the listeners for the checkboxes and sets the listbox
     * for anything that is checked.
     * 
     * @param e the event passed
     */
    public void itemStateChanged(ItemEvent e) {
        saveNeeded = true;
        if (entryCheckBox.isSelected() && !roomList.contains("Entry Room")) {
            roomList.addElement("Entry Room");
            roomCount++;


        }
        if (livingRoomCheckBox.isSelected() && !roomList.contains("Living Room")) {
            roomList.addElement("Living Room");
            roomCount++;

        }
        if (diningRoomCheckBox.isSelected() && !roomList.contains("Dining Room")) {
            roomList.addElement("Dining Room");
            roomCount++;

        }
        if (kitchenCheckBox.isSelected() && !roomList.contains("Kitchen")) {
            roomList.addElement("Kitchen");
            roomCount++;

        }
        if (familyRoomCheckBox.isSelected() && !roomList.contains("Family Room")) {
            roomList.addElement("Family Room");
            roomCount++;

        }
        if (studyCheckBox.isSelected() && !roomList.contains("Study")) {
            roomList.addElement("Study");
            roomCount++;

        }
        if (!entryCheckBox.isSelected()) {
            roomCount--;
            if (roomList.getSize() == 1) {
                roomListHolder.setEnabled(false);
            } else {
                roomListHolder.setSelectedIndex(1);
            }
            roomList.removeElement("Entry Room");
            this.bottomLeft.remove(entryListPanel);
            bottomLeft.add(listScroller, BorderLayout.WEST);
            this.bottomLeft.repaint();
            roomListHolder.setEnabled(true);
        }
        if (!livingRoomCheckBox.isSelected()) {
            roomCount--;
            if (roomList.getSize() == 1) {
                roomListHolder.setEnabled(false);
            } else {
                roomListHolder.setSelectedIndex(0);
            }
            roomList.removeElement("Living Room");
            this.bottomLeft.remove(livingRoomListPanel);
            bottomLeft.add(listScroller, BorderLayout.WEST);
            this.bottomLeft.repaint();
            roomListHolder.setEnabled(true);


        }
        if (!diningRoomCheckBox.isSelected()) {
            roomCount--;
            if (roomList.getSize() == 1) {
                roomListHolder.setEnabled(false);
            } else {
                roomListHolder.setSelectedIndex(1);
            }
            roomList.removeElement("Dining Room");
            this.bottomLeft.remove(diningRoomListPanel);
            bottomLeft.add(listScroller, BorderLayout.WEST);
            this.bottomLeft.repaint();
            roomListHolder.setEnabled(true);
        }
        if (!kitchenCheckBox.isSelected()) {
            roomCount--;
            if (roomList.getSize() == 1) {
                roomListHolder.setEnabled(false);
            } else {
                roomListHolder.setSelectedIndex(1);
            }
            roomList.removeElement("Kitchen");
            this.bottomLeft.remove(kitchenListPanel);
            bottomLeft.add(listScroller, BorderLayout.WEST);
            this.bottomLeft.repaint();
            bottomLeft.revalidate();
            roomListHolder.setEnabled(true);
        }


        if (!familyRoomCheckBox.isSelected()) {
            roomCount--;
            if (roomList.getSize() == 1) {
                roomListHolder.setEnabled(false);
            } else {
                roomListHolder.setSelectedIndex(1);
            }
            roomList.removeElement("Family Room");
            this.bottomLeft.remove(familyRoomListPanel);
            bottomLeft.add(listScroller, BorderLayout.WEST);
            this.bottomLeft.repaint();
            roomListHolder.setEnabled(true);
        }
        if (!studyCheckBox.isSelected()) {
            roomCount--;
            if (roomList.getSize() == 1) {
                roomListHolder.setEnabled(false);
            } else {
                roomListHolder.setSelectedIndex(0);
            }
            roomList.removeElement("Study");
            this.bottomLeft.remove(studyListPanel);
            bottomLeft.add(listScroller, BorderLayout.WEST);
            this.bottomLeft.repaint();
            bottomLeft.revalidate();
            roomListHolder.setEnabled(true);
        }
        createBottomLeft();
        this.revalidate();
    }

    public void actionPerformed(ActionEvent e) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    /**
     * Initializes all the components of the page
     */
    private void initComponents() {
        currentUnit = 0;
        saveNeeded = false;
        bdrmLabel = new JLabel("Bedrooms( # of)");
        bdrmComboBox = new JComboBox(bdrmChoices);
        bathLabel = new JLabel("Bathrooms( # of)");
        bathComboBox = new JComboBox(bathChoices);
        lotSizeLabel = new JLabel("Lot Size");
        yearBuiltLabel = new JLabel("Year Built");
        listDateLabel = new JLabel("List Date(##/##/##)");
        schoolDistrictLabel = new JLabel("School District");
        tenantNameLabel = new JLabel("Tenant Name");
        numberOfRoomsLabel = new JLabel("Rooms( # of)");
        numberOfFireplacesLabel = new JLabel("Fireplaces(#of)");
        garageSpacesLabel = new JLabel("Garage Size");
        garageSpacesComboBox = new JComboBox(garageSpacesSelection);
        apartmentLevelLabel = new JLabel("Apartment Level");
        apartmentLevelComboBox = new JComboBox(apartmentLevelSelection);
        heatPaidLabel = new JLabel("Heat Paid By");
        heatPaidComboBox = new JComboBox(ownerTenantSelection);
        waterPaidLabel = new JLabel("Water Paid By");
        waterPaidComboBox = new JComboBox(ownerTenantSelection);
        airConditionYesNoComboBox = new JComboBox(yesNoSelection);
        separateFurnaceYesNoComboBox = new JComboBox(yesNoSelection);
        separateGasYesNoComboBox = new JComboBox(yesNoSelection);
        disabilityAccessYesNoComboBox = new JComboBox(yesNoSelection);
        airConSeparateLabel = new JLabel("Separate A/C");
        sepFurnaceLabel = new JLabel("Separate Furnace");
        sepGasElectricLabel = new JLabel("Separate Gas & Ele.");
        disabilityAccessLabel = new JLabel("Disability Access");
        firstFloorBdrmYesNoComboBox = new JComboBox(yesNoSelection);
        familyRoomYesNoComboBox = new JComboBox(yesNoSelection);
        firstFloorBathroomYesNoComboBox = new JComboBox(yesNoSelection);
        diningRoomYesNoComboBox = new JComboBox(yesNoSelection);
        entryCheckBox = new JCheckBox("Entry");
        livingRoomCheckBox = new JCheckBox("Living Room");
        diningRoomCheckBox = new JCheckBox("Dining Room");
        kitchenCheckBox = new JCheckBox("Kitchen");
        breakfastCheckBox = new JCheckBox("Breakfast Nook");
        familyRoomCheckBox = new JCheckBox("Family Room");
        studyCheckBox = new JCheckBox("Study");
        recRoomCheckBox = new JCheckBox("Recreation Room");
        laundryRoomCheckBox = new JCheckBox("Laundry Rroom");
        roomList = new DefaultListModel();
        roomListHolder = new JList(roomList);
        listScroller = new JScrollPane(roomListHolder);
        topLeft = new JPanel();
        topRight = new JPanel();
        bottomLeft = new JPanel();
        bottomRight = new JPanel();
        tenantOwnerPanel = new JPanel();
        houseInfoPanel = new JPanel();
        roomPanel = new JPanel();
        roomInfoPanel = new JPanel();
        entryListPanel = new JPanel();
        kitchenListPanel = new JPanel();
        studyListPanel = new JPanel();
        diningRoomListPanel = new JPanel();
        livingRoomListPanel = new JPanel();
        familyRoomListPanel = new JPanel();
        masterBedroomListPanel = new JPanel();
        woodFloorMasterBedroomCkBox = new JCheckBox("Wood Floors");
        wwCarpetMasterBedroomCkBox = new JCheckBox("WW Carpet");
        bathAdjoinsMasterBedroomCkBox = new JCheckBox("Bath Adjoins");
        firePlaceMasterBedroomCkBox = new JCheckBox("Fireplace");
        walkoutMasterBedroomCkBox = new JCheckBox("Walkout");
        windowTreatMasterBedroomCkBox = new JCheckBox("Window Treatments");
        sittingRoomMasterBedroomCkBox = new JCheckBox("Sitting Room");
        skyLightMasterBedroomCkBox = new JCheckBox("Skylight");
        closetMasterBedroomCkBox = new JCheckBox("Walk-In Closet");
        dressAreaMasterBedroomCkBox = new JCheckBox("Dress Area");
        vaultedCeilingMasterBedroomCkBox = new JCheckBox("Vaulted Ceiling");
        commentMasterBedroomLabel = new JLabel("Comments");
        dimOfMasterBedroom = new JPanel(new GridLayout(1, 3));
        woodFloorEntryCkBox = new JCheckBox("Wood Floors");
        laminateFloorEntryCkBox = new JCheckBox("Laminate Flooring");
        vinylFloorEntryCkBox = new JCheckBox("Vinyl Floors");
        firePlaceEntryCkBox = new JCheckBox("Fireplace");
        walkoutEntryCkBox = new JCheckBox("Walkout");
        windowTreatEntryCkBox = new JCheckBox("Window Treatments");
        bookcaseEntryCkBox = new JCheckBox("Bookcase");
        frenchDoorsEntryCkBox = new JCheckBox("French Doors");
        closetEntryCkBox = new JCheckBox("Closet");
        foyerEntryCkBox = new JCheckBox("Open Foyer");
        doubleDoorsEntryCkBox = new JCheckBox("Double Doors");
        commentEntryLabel = new JLabel("Comments");
        dimOfEntryRoom = new JPanel(new GridLayout(1, 3));
        woodFloorFamilyRoomCkBox = new JCheckBox("Wood Floors");
        laminateFloorFamilyRoomCkBox = new JCheckBox("Laminate Flooring");
        wwCarpetFamilyRoomCkBox = new JCheckBox("WW Carpet");
        firePlaceFamilyRoomCkBox = new JCheckBox("Fireplace");
        walkoutFamilyRoomCkBox = new JCheckBox("Walkout");
        windowTreatFamilyRoomCkBox = new JCheckBox("Window Treatments");
        bookcaseFamilyRoomCkBox = new JCheckBox("Bookcase");
        frenchDoorsFamilyRoomCkBox = new JCheckBox("French Doors");
        panelWallsFamilyRoomCkBox = new JCheckBox("Panel Walls");
        dryBarFamilyRoomCkBox = new JCheckBox("Dry Bar");
        skylightFamilyRoomCkBox = new JCheckBox("Skylight");
        commentFamilyRoomLabel = new JLabel("Comments");
        dimOfFamilyRoom = new JPanel(new GridLayout(1, 3));
        woodFloorDiningRoomCkBox = new JCheckBox("Wood Floors");
        laminateFloorDiningRoomCkBox = new JCheckBox("Laminate Flooring");
        wwCarpetDiningRoomCkBox = new JCheckBox("WW Carpet");
        firePlaceDiningRoomCkBox = new JCheckBox("Fireplace");
        walkoutDiningRoomCkBox = new JCheckBox("Walkout");
        windowTreatDiningRoomCkBox = new JCheckBox("Window Treatments");
        chairRailDiningRoomCkBox = new JCheckBox("Chair Rail");
        frenchDoorsDiningRoomCkBox = new JCheckBox("French Doors");
        chandelierDiningRoomCkBox = new JCheckBox("Chandelier");
        builtInsDiningRoomCkBox = new JCheckBox("Built-ins");
        commentDiningRoomLabel = new JLabel("Comments");
        dimOfDiningRoom = new JPanel(new GridLayout(1, 3));
        woodFloorLivingRoomCkBox = new JCheckBox("Wood Floors");
        laminateFloorLivingRoomCkBox = new JCheckBox("Laminate Flooring");
        wwCarpetLivingRoomCkBox = new JCheckBox("WW Carpet");
        firePlaceLivingRoomCkBox = new JCheckBox("Fireplace");
        walkoutLivingRoomCkBox = new JCheckBox("Walkout");
        windowTreatLivingRoomCkBox = new JCheckBox("Window Treatments");
        bookcaseLivingRoomCkBox = new JCheckBox("Bookcase");
        skylightLivingRoomCkBox = new JCheckBox("Skylight");
        wetBarLivingRoomCkBox = new JCheckBox("Wet Bar");
        dryBarLivingRoomCkBox = new JCheckBox("Dry Bar");
        doubleDoorsLivingRoomCkBox = new JCheckBox("Double Doors");
        commentLivingRoomLabel = new JLabel("Comments");
        woodFloorKitchenCkBox = new JCheckBox("Wood Floors");
        laminateFloorKitchenCkBox = new JCheckBox("Laminate Flooring");
        vinylFloorKitchenCkBox = new JCheckBox("Vinyl Floors");
        firePlaceKitchenCkBox = new JCheckBox("Fireplace");
        stoneCounterKitchenCkBox = new JCheckBox("Marb/Gran/Slate");
        windowTreatKitchenCkBox = new JCheckBox("Window Treatments");
        ceramicTileKitchenCkBox = new JCheckBox("Ceramic Tile");
        eatInKitchenCkBox = new JCheckBox("Eat In");
        gourmetKitchenCkBox = new JCheckBox("Gourmet");
        countryKitchenCkBox = new JCheckBox("Country");
        galleyKitchenCkBox = new JCheckBox("Galley");
        woodCabinetsKitchenCkBox = new JCheckBox("Wood Cabinets");
        pantryKitchenCkBox = new JCheckBox("Pantry");
        islandKitchenCkBox = new JCheckBox("Island");
        counterBarKitchenCkBox = new JCheckBox("Counter Bar");
        solidSurfaceKitchenCkBox = new JCheckBox("Solid Surface Counter");
        commentKitchenLabel = new JLabel("Comments");
        dimOfKitchen = new JPanel(new GridLayout(1, 3));
        woodFloorStudyCkBox = new JCheckBox("Wood Floors");
        laminateFloorStudyCkBox = new JCheckBox("Laminate Flooring");
        wwCarpetStudyCkBox = new JCheckBox("WW Carpet");
        firePlaceStudyCkBox = new JCheckBox("Fireplace");
        walkoutStudyCkBox = new JCheckBox("Walkout");
        windowTreatStudyCkBox = new JCheckBox("Window Treatments");
        bookcaseStudyCkBox = new JCheckBox("Bookcase");
        frenchDoorsStudyCkBox = new JCheckBox("French Doors");
        closetStudyCkBox = new JCheckBox("Closet");
        commentStudyLabel = new JLabel("Comments");
        dimOfStudy = new JPanel(new GridLayout(1, 3));
        lotDimensions1Label = new JTextField(4);
        lotDimensions2Label = new JTextField(4);
        masterBedroomCommentTextArea = new TextArea("Enter Comments", 3, 15);
        masterBedroomWidth = new JTextField(4);
        masterBedroomLength = new JTextField(4);
        entryCommentTextArea = new JTextArea("Enter Comments", 3, 15);
        entryRoomWidth = new JTextField(4);
        entryRoomLength = new JTextField(4);
        familyRoomCommentTextArea = new TextArea("Enter Comments", 3, 15);
        familyRoomWidth = new JTextField(4);
        familyRoomLength = new JTextField(4);
        diningRoomCommentTextArea = new TextArea("Enter Comments", 3, 15);
        DiningRoomWidth = new JTextField(4);
        DiningRoomLength = new JTextField(4);
        livingRoomCommentTextArea = new TextArea("Enter Comments", 3, 15);
        livingRoomWidth = new JTextField(4);
        livingRoomLength = new JTextField(4);
        KitchenCommentTextArea = new TextArea("Enter Comments", 3, 15);
        kitchenWidth = new JTextField(4);
        kitchenLength = new JTextField(4);
        studyCommentTextArea = new TextArea("Enter Comments", 3, 15);
        studyWidth = new JTextField(4);
        studyLength = new JTextField(4);
        lotSizeTextField = new JTextField(6);
        yearBuiltTextField = new JTextField(4);
        listDateTextField = new JFormattedTextField(new SimpleDateFormat("MM/dd/yy"));
        schoolDistrictTextField = new JTextField(10);
        tenantNameTextField = new JTextField(20);
        numberOfRoomsTextField = new JTextField(2);
        numberOfFireplacesTextField = new JTextField(1);


    }

    /**
     * Checks to see if the data in a text field is null, if it is
     * return 0
     */
    private String validateNonNull(String var) {
        return (var == null) ? "0" : var;
    }

    /**
     * Save Functionality
     */
    public void saveFunction() {
//        System.out.println("roomCount:" + roomCount);
//        System.out.println("roomList:" + roomList.size());
        if (!saveNeeded) {
            return;
        } else {
            saveProperty();
//            saveUnit();
//            saveRooms();
            saveNeeded = false;
        }
    }

    /**
     * saves all the information from the form to the property object
     */
    private void saveProperty() {
        propertyObject = this.pep.getProperty();
        propertyObject.setAmenities(pfp.getAmenitiesCBConverter());
        propertyObject.setBasement(pfp.getBasementCBConverter());
        propertyObject.setBuildings(pfp.getBuildingCBConverter());
        propertyObject.setDocs(pfp.getDocumentsCBConverter());
        propertyObject.setInside(pfp.getInsideFeatCBConverter());
        propertyObject.setOutside(pfp.getOutsideFeatCBConverter());
        propertyObject.setMisc(pfp.getMiscCBConverter());
        propertyObject.setZoning(Integer.toString(pfp.getZoningCBConverter()));
        propertyObject.setPview(pfp.getViewCBConverter());
        propertyObject.setYearbuilt(getYearBuilt());
        saveUnit();
    }

    private int getYearBuilt() {
        try {
            return Integer.parseInt(yearBuiltTextField.getText());
        } catch (Exception e) {
            return 0;
        }
    }

    private int getNumberOfFireplaces() {
        try {
            return Integer.parseInt(numberOfFireplacesTextField.getText());
        } catch (Exception e) {
            return 0;
        }
    }

    private int getNumberOfRooms() {
        try {
            return Integer.parseInt(numberOfRoomsTextField.getText());
        } catch (Exception e) {
            return 0;
        }
    }

    protected Boolean isSaveNeeded() {
        return saveNeeded;
    }

    /**
     * Saves all the unit data from the form to the object
     */
    protected Unit saveUnit() {
        if (saveNeeded) {
            unitObject.setHeatincluded(heatPaidComboBox.getSelectedIndex());
            unitObject.setWaterincluded(waterPaidComboBox.getSelectedIndex());
            unitObject.setSeparatefurnace(separateFurnaceYesNoComboBox.getSelectedIndex());
            unitObject.setSeparateac(airConditionYesNoComboBox.getSelectedIndex());
            unitObject.setSeparategaselectric(separateGasYesNoComboBox.getSelectedIndex());
            unitObject.setDisabilityaccess(disabilityAccessYesNoComboBox.getSelectedIndex());
            unitObject.setFirstfloorbdrm(firstFloorBdrmYesNoComboBox.getSelectedIndex());
            unitObject.setFirstfloorbath(firstFloorBathroomYesNoComboBox.getSelectedIndex());
            unitObject.setFamilyroom(familyRoomYesNoComboBox.getSelectedIndex());
            unitObject.setDiningroom(diningRoomYesNoComboBox.getSelectedIndex());
            unitObject.setGaragespaces(garageSpacesComboBox.getSelectedIndex());
            unitObject.setNumberoffireplaces(getNumberOfFireplaces());
            unitObject.setNumberOfBedrooms(bdrmComboBox.getSelectedIndex());
            unitObject.setGaragespaces(garageSpacesComboBox.getSelectedIndex());
            unitObject.setNumberofrooms(getNumberOfRooms());
            unitObject.setNumberOfBathrooms(bathComboBox.getSelectedIndex());
            unitObject.setTenantName(tenantNameTextField.getText());
            unitObject.setRoomList(saveRooms());
            try {
                unitObject.setListdate(new Date(listDateTextField.getText().toString()));
            } catch (Exception e) {
            }
            if (currentUnit > -1) {
                propertyObject.setUnit(currentUnit, unitObject);
            } else {
                propertyObject.addUnit(unitObject);
            }
            return unitObject;
        }
        return unitObject;
    }

    /**
     * saves all the room information from the forms to the room object
     * @return an array of the rooms created
     */
    protected Room[] saveRooms() {
        Room[] roomLists = new Room[roomList.size()];
        int i = 0;
        if (diningRoomCBConverter.getValue() > 0) {
            Room room = new Room();
            room.setLabel("Dining Room");
            room.setFeatures(Integer.toString(diningRoomCBConverter.getValue()));
            try {
                room.setRlength(Integer.parseInt(validateNonNull(DiningRoomLength.getText())));
            } catch (Exception e) {
                room.setRlength(0);
            }
            try {
                room.setWidth(Integer.parseInt(validateNonNull(DiningRoomWidth.getText())));
            } catch (Exception e) {
                room.setWidth(0);
            }
            roomLists[i] = room;
            i++;

        }
        if (entryRoomCBConverter.getValue() > 0) {
            Room room = new Room();
            room.setLabel("Entry Room");
            room.setFeatures(Integer.toString(entryRoomCBConverter.getValue()));
            try {
                room.setRlength(Integer.parseInt(validateNonNull(entryRoomLength.getText())));
            } catch (Exception e) {
                room.setRlength(0);
            }
            ;
            try {
                room.setWidth(Integer.parseInt(validateNonNull(entryRoomWidth.getText())));
            } catch (Exception e) {
                room.setWidth(0);
            }
            roomLists[i] = room;
            i++;

        }
        if (familyRoomCBConverter.getValue() > 0) {
            Room room = new Room();
            room.setLabel("Family Room");
            room.setFeatures(Integer.toString(familyRoomCBConverter.getValue()));
            try {
                room.setRlength(Integer.parseInt(validateNonNull(familyRoomLength.getText())));
            } catch (Exception e) {
                room.setRlength(0);
            }
            try {
                room.setWidth(Integer.parseInt(validateNonNull(familyRoomWidth.getText())));
            } catch (Exception e) {
                room.setWidth(0);
            }
            roomLists[i] = room;
            i++;

        }


        if (kitchenCBConverter.getValue() > 0) {
            Room room = new Room();
            room.setLabel("Kitchen");
            room.setFeatures(Integer.toString(kitchenCBConverter.getValue()));
            try {
                room.setRlength(Integer.parseInt(validateNonNull(kitchenLength.getText())));
            } catch (Exception e) {
                room.setRlength(0);
            }
            try {
                room.setWidth(Integer.parseInt(validateNonNull(kitchenWidth.getText())));
            } catch (Exception e) {
                room.setWidth(0);
            }
            roomLists[i] = room;
            i++;

        }

        if (livingRoomCBConverter.getValue() > 0) {
            Room room = new Room();
            room.setLabel("Living Room");
            room.setFeatures(Integer.toString(livingRoomCBConverter.getValue()));
            try {
                room.setRlength(Integer.parseInt(validateNonNull(livingRoomLength.getText())));
            } catch (Exception e) {
                room.setRlength(0);
            }
            try {
                room.setWidth(Integer.parseInt(validateNonNull(livingRoomWidth.getText())));
            } catch (Exception e) {
                room.setWidth(0);
            }
            roomLists[i] = room;
            i++;

        }
        if (masterBedroomCBConverter.getValue() > 0) {
            Room room = new Room();
            room.setLabel("Master Bedroom");
            room.setFeatures(Integer.toString(masterBedroomCBConverter.getValue()));
            try {
                room.setRlength(Integer.parseInt(validateNonNull(masterBedroomLength.getText())));
            } catch (Exception e) {
                room.setRlength(0);
            }
            try {
                room.setWidth(Integer.parseInt(validateNonNull(masterBedroomWidth.getText())));
            } catch (Exception e) {
                room.setWidth(0);
            }
            roomLists[i] = room;
            i++;

        }
        if (studyCBConverter.getValue() > 0) {
            Room room = new Room();
            room.setLabel("Study");
            try {
                room.setFeatures(Integer.toString(studyCBConverter.getValue()));
            } catch (Exception e) {
                room.setRlength(0);
            }
            try {
                room.setRlength(Integer.parseInt(validateNonNull(studyLength.getText())));
            } catch (Exception e) {
                room.setWidth(0);
            }
            roomLists[i] = room;
            i++;
        }
        return roomLists;
    }

    /**
     * sets the Kitchen checkboxes for data loading purposes
     */
    private void setKitchenCheckboxes() {
        woodFloorKitchenCkBox.setEnabled(kitchenCBConverter.checkOn(kitchenCBConverter.BOX1));
        ceramicTileKitchenCkBox.setEnabled(kitchenCBConverter.checkOn(kitchenCBConverter.BOX2));
        counterBarKitchenCkBox.setEnabled(kitchenCBConverter.checkOn(kitchenCBConverter.BOX3));
        countryKitchenCkBox.setEnabled(kitchenCBConverter.checkOn(kitchenCBConverter.BOX4));
        firePlaceKitchenCkBox.setEnabled(kitchenCBConverter.checkOn(kitchenCBConverter.BOX5));
        eatInKitchenCkBox.setEnabled(kitchenCBConverter.checkOn(kitchenCBConverter.BOX6));
        galleyKitchenCkBox.setEnabled(kitchenCBConverter.checkOn(kitchenCBConverter.BOX7));
        laminateFloorKitchenCkBox.setEnabled(kitchenCBConverter.checkOn(kitchenCBConverter.BOX8));
        vinylFloorKitchenCkBox.setEnabled(kitchenCBConverter.checkOn(kitchenCBConverter.BOX9));
        islandKitchenCkBox.setEnabled(kitchenCBConverter.checkOn(kitchenCBConverter.BOX10));
        solidSurfaceKitchenCkBox.setEnabled(kitchenCBConverter.checkOn(kitchenCBConverter.BOX11));
        vinylFloorKitchenCkBox.setEnabled(kitchenCBConverter.checkOn(kitchenCBConverter.BOX12));
        stoneCounterKitchenCkBox.setEnabled(kitchenCBConverter.checkOn(kitchenCBConverter.BOX13));
        woodCabinetsKitchenCkBox.setEnabled(kitchenCBConverter.checkOn(kitchenCBConverter.BOX14));
        windowTreatKitchenCkBox.setEnabled(kitchenCBConverter.checkOn(kitchenCBConverter.BOX15));
        pantryKitchenCkBox.setEnabled(kitchenCBConverter.checkOn(kitchenCBConverter.BOX16));




    }

    /**
     * sets the study checkboxes for data loading purposes
     */
    private void setStudyCheckBoxes() {
        woodFloorStudyCkBox.setEnabled(studyCBConverter.checkOn(studyCBConverter.BOX1));
        bookcaseStudyCkBox.setEnabled(studyCBConverter.checkOn(studyCBConverter.BOX2));
        closetStudyCkBox.setEnabled(studyCBConverter.checkOn(studyCBConverter.BOX3));
        wwCarpetStudyCkBox.setEnabled(studyCBConverter.checkOn(studyCBConverter.BOX4));
        firePlaceStudyCkBox.setEnabled(studyCBConverter.checkOn(studyCBConverter.BOX5));
        laminateFloorStudyCkBox.setEnabled(studyCBConverter.checkOn(studyCBConverter.BOX6));
        frenchDoorsStudyCkBox.setEnabled(studyCBConverter.checkOn(studyCBConverter.BOX7));
        walkoutStudyCkBox.setEnabled(studyCBConverter.checkOn(studyCBConverter.BOX8));
        windowTreatStudyCkBox.setEnabled(studyCBConverter.checkOn(studyCBConverter.BOX9));





    }

    /**
     * sets the living room checkboxes for data loading purposes
     */
    private void setLivingRoomCheckBoxes() {
        woodFloorLivingRoomCkBox.setEnabled(livingRoomCBConverter.checkOn(livingRoomCBConverter.BOX1));
        wetBarLivingRoomCkBox.setEnabled(livingRoomCBConverter.checkOn(livingRoomCBConverter.BOX2));
        bookcaseLivingRoomCkBox.setEnabled(livingRoomCBConverter.checkOn(livingRoomCBConverter.BOX3));
        skylightLivingRoomCkBox.setEnabled(livingRoomCBConverter.checkOn(livingRoomCBConverter.BOX4));
        wwCarpetLivingRoomCkBox.setEnabled(livingRoomCBConverter.checkOn(livingRoomCBConverter.BOX5));
        firePlaceLivingRoomCkBox.setEnabled(livingRoomCBConverter.checkOn(livingRoomCBConverter.BOX6));
        laminateFloorLivingRoomCkBox.setEnabled(livingRoomCBConverter.checkOn(livingRoomCBConverter.BOX7));
        dryBarLivingRoomCkBox.setEnabled(livingRoomCBConverter.checkOn(livingRoomCBConverter.BOX8));
        walkoutLivingRoomCkBox.setEnabled(livingRoomCBConverter.checkOn(livingRoomCBConverter.BOX9));
        windowTreatLivingRoomCkBox.setEnabled(livingRoomCBConverter.checkOn(livingRoomCBConverter.BOX10));




    }

    /**
     * sets the Master checkboxes for data loading purposes
     */
    private void setMasterCheckBoxes() {
        woodFloorMasterBedroomCkBox.setEnabled(masterBedroomCBConverter.checkOn(masterBedroomCBConverter.BOX1));
        skyLightMasterBedroomCkBox.setEnabled(masterBedroomCBConverter.checkOn(masterBedroomCBConverter.BOX2));
        sittingRoomMasterBedroomCkBox.setEnabled(masterBedroomCBConverter.checkOn(masterBedroomCBConverter.BOX3));
        wwCarpetMasterBedroomCkBox.setEnabled(masterBedroomCBConverter.checkOn(masterBedroomCBConverter.BOX4));
        firePlaceMasterBedroomCkBox.setEnabled(masterBedroomCBConverter.checkOn(masterBedroomCBConverter.BOX5));
        closetMasterBedroomCkBox.setEnabled(masterBedroomCBConverter.checkOn(masterBedroomCBConverter.BOX6));
        bathAdjoinsMasterBedroomCkBox.setEnabled(masterBedroomCBConverter.checkOn(masterBedroomCBConverter.BOX7));
        walkoutMasterBedroomCkBox.setEnabled(masterBedroomCBConverter.checkOn(masterBedroomCBConverter.BOX8));
        windowTreatMasterBedroomCkBox.setEnabled(masterBedroomCBConverter.checkOn(masterBedroomCBConverter.BOX9));
        vaultedCeilingMasterBedroomCkBox.setEnabled(masterBedroomCBConverter.checkOn(masterBedroomCBConverter.BOX10));




    }

    /**
     * sets the Family Room checkboxes for data loading purposes
     */
    private void setFamilyRoomCheckBoxes() {
        woodFloorFamilyRoomCkBox.setEnabled(familyRoomCBConverter.checkOn(familyRoomCBConverter.BOX1));
        skylightFamilyRoomCkBox.setEnabled(familyRoomCBConverter.checkOn(familyRoomCBConverter.BOX2));
        panelWallsFamilyRoomCkBox.setEnabled(familyRoomCBConverter.checkOn(familyRoomCBConverter.BOX3));
        wwCarpetFamilyRoomCkBox.setEnabled(familyRoomCBConverter.checkOn(familyRoomCBConverter.BOX4));
        firePlaceFamilyRoomCkBox.setEnabled(familyRoomCBConverter.checkOn(familyRoomCBConverter.BOX5));
        laminateFloorFamilyRoomCkBox.setEnabled(familyRoomCBConverter.checkOn(familyRoomCBConverter.BOX6));
        dryBarFamilyRoomCkBox.setEnabled(familyRoomCBConverter.checkOn(familyRoomCBConverter.BOX7));
        walkoutFamilyRoomCkBox.setEnabled(familyRoomCBConverter.checkOn(familyRoomCBConverter.BOX8));
        windowTreatFamilyRoomCkBox.setEnabled(familyRoomCBConverter.checkOn(familyRoomCBConverter.BOX9));




    }

    /**
     * sets the Dining Room checkboxes for data loading purposes
     */
    private void setDiningRoomCheckBoxes() {

        woodFloorDiningRoomCkBox.setSelected(diningRoomCBConverter.checkOn(diningRoomCBConverter.BOX1));
        chandelierDiningRoomCkBox.setSelected(diningRoomCBConverter.checkOn(diningRoomCBConverter.BOX2));
        chairRailDiningRoomCkBox.setSelected(diningRoomCBConverter.checkOn(diningRoomCBConverter.BOX3));
        wwCarpetDiningRoomCkBox.setSelected(diningRoomCBConverter.checkOn(diningRoomCBConverter.BOX4));
        firePlaceDiningRoomCkBox.setSelected(diningRoomCBConverter.checkOn(diningRoomCBConverter.BOX5));
        laminateFloorDiningRoomCkBox.setSelected(diningRoomCBConverter.checkOn(diningRoomCBConverter.BOX6));
        builtInsDiningRoomCkBox.setSelected(diningRoomCBConverter.checkOn(diningRoomCBConverter.BOX8));
        walkoutDiningRoomCkBox.setSelected(diningRoomCBConverter.checkOn(diningRoomCBConverter.BOX9));
        windowTreatDiningRoomCkBox.setSelected(diningRoomCBConverter.checkOn(diningRoomCBConverter.BOX10));




    }

    /**
     * sets the Other fields checkboxes for data loading purposes
     */
    private void setOtherFields() {
        numberOfFireplacesTextField.setText(Integer.toString(unitObject.getNumberoffireplaces()));
        bathComboBox.setSelectedIndex(unitObject.getNumberOfBathrooms());
        bdrmComboBox.setSelectedIndex(unitObject.getNumberOfBedrooms());
        yearBuiltTextField.setText(propertyObject.getYearbuilt().toString());
        listDateTextField.setText(unitObject.getListdate().toString());
        tenantNameTextField.setText(unitObject.getTenantName());
        numberOfRoomsTextField.setText(Integer.toString(unitObject.getNumberofrooms()));
        garageSpacesComboBox.setSelectedIndex(unitObject.getGaragespaces());
        heatPaidComboBox.setSelectedIndex(unitObject.getHeatincluded());
        waterPaidComboBox.setSelectedIndex(unitObject.getWaterincluded());
        separateFurnaceYesNoComboBox.setSelectedIndex(unitObject.getSeparatefurnace());
        separateGasYesNoComboBox.setSelectedIndex(unitObject.getSeparategaselectric());
        airConditionYesNoComboBox.setSelectedIndex(unitObject.getSeparateac());
        disabilityAccessYesNoComboBox.setSelectedIndex(unitObject.getDisabilityaccess());
        firstFloorBathroomYesNoComboBox.setSelectedIndex(unitObject.getFirstfloorbath());
        firstFloorBdrmYesNoComboBox.setSelectedIndex(unitObject.getFirstfloorbdrm());
        familyRoomYesNoComboBox.setSelectedIndex(unitObject.getFamilyroom());
        diningRoomYesNoComboBox.setSelectedIndex(unitObject.getDiningroom());






    }

    /**
     * calling all the other check boxes
     */
    private void setCheckBoxes() {
        setDiningRoomCheckBoxes();
        setLivingRoomCheckBoxes();
        setMasterCheckBoxes();
        setStudyCheckBoxes();
        setDiningRoomCheckBoxes();
        setKitchenCheckboxes();
        setFamilyRoomCheckBoxes();






    }
    private DAO daoObject;
    private boolean saveNeeded;
    private int currentUnit;
    private int roomCount = 0;
    private int unitNumber = 0;
    private JPanel bottomLeft;
    private JPanel bottomRight;
    private JPanel diningRoomListPanel;
    private JPanel entryListPanel;
    private JPanel familyRoomListPanel;
    private JPanel houseInfoPanel;
    private JPanel kitchenListPanel;
    private JPanel livingRoomListPanel;
    private JPanel masterBedroomListPanel;
    private JPanel roomInfoPanel;
    private JPanel roomPanel;
    private JPanel studyListPanel;
    private JPanel tenantOwnerPanel;
    private JPanel topLeft;
    private JPanel topRight;
    private Property propertyObject;
    private PropertyEntryPanel pep;
    private Unit unitObject;
    private CheckBoxConverter diningRoomCBConverter = new CheckBoxConverter(8);
    private CheckBoxConverter entryRoomCBConverter = new CheckBoxConverter(11);
    private CheckBoxConverter familyRoomCBConverter = new CheckBoxConverter(9);
    private CheckBoxConverter kitchenCBConverter = new CheckBoxConverter(15);
    private CheckBoxConverter livingRoomCBConverter = new CheckBoxConverter(10);
    private CheckBoxConverter masterBedroomCBConverter = new CheckBoxConverter(9);
    private CheckBoxConverter studyCBConverter = new CheckBoxConverter(9);
    private DefaultListModel roomList;
    private JCheckBox bathAdjoinsMasterBedroomCkBox;
    private JCheckBox bookcaseEntryCkBox;
    private JCheckBox bookcaseFamilyRoomCkBox;
    private JCheckBox bookcaseLivingRoomCkBox;
    private JCheckBox bookcaseStudyCkBox;
    private JCheckBox breakfastCheckBox;
    private JCheckBox builtInsDiningRoomCkBox;
    private JCheckBox ceramicTileKitchenCkBox;
    private JCheckBox chairRailDiningRoomCkBox;
    private JCheckBox chandelierDiningRoomCkBox;
    private JCheckBox closetEntryCkBox;
    private JCheckBox closetMasterBedroomCkBox;
    private JCheckBox closetStudyCkBox;
    private JCheckBox counterBarKitchenCkBox;
    private JCheckBox countryKitchenCkBox;
    private JCheckBox diningRoomCheckBox;
    private JCheckBox doubleDoorsEntryCkBox;
    private JCheckBox doubleDoorsLivingRoomCkBox;
    private JCheckBox dressAreaMasterBedroomCkBox;
    private JCheckBox dryBarFamilyRoomCkBox;
    private JCheckBox dryBarLivingRoomCkBox;
    private JCheckBox eatInKitchenCkBox;
    private JCheckBox entryCheckBox;
    private JCheckBox familyRoomCheckBox;
    private JCheckBox firePlaceDiningRoomCkBox;
    private JCheckBox firePlaceEntryCkBox;
    private JCheckBox firePlaceFamilyRoomCkBox;
    private JCheckBox firePlaceKitchenCkBox;
    private JCheckBox firePlaceLivingRoomCkBox;
    private JCheckBox firePlaceMasterBedroomCkBox;
    private JCheckBox firePlaceStudyCkBox;
    private JCheckBox foyerEntryCkBox;
    private JCheckBox frenchDoorsDiningRoomCkBox;
    private JCheckBox frenchDoorsEntryCkBox;
    private JCheckBox frenchDoorsFamilyRoomCkBox;
    private JCheckBox frenchDoorsStudyCkBox;
    private JCheckBox galleyKitchenCkBox;
    private JCheckBox gourmetKitchenCkBox;
    private JCheckBox islandKitchenCkBox;
    private JCheckBox kitchenCheckBox;
    private JCheckBox laminateFloorDiningRoomCkBox;
    private JCheckBox laminateFloorEntryCkBox;
    private JCheckBox laminateFloorFamilyRoomCkBox;
    private JCheckBox laminateFloorKitchenCkBox;
    private JCheckBox laminateFloorLivingRoomCkBox;
    private JCheckBox laminateFloorStudyCkBox;
    private JCheckBox laundryRoomCheckBox;
    private JCheckBox livingRoomCheckBox;
    private JCheckBox panelWallsFamilyRoomCkBox;
    private JCheckBox pantryKitchenCkBox;
    private JCheckBox recRoomCheckBox;
    private JCheckBox sittingRoomMasterBedroomCkBox;
    private JCheckBox skylightFamilyRoomCkBox;
    private JCheckBox skylightLivingRoomCkBox;
    private JCheckBox skyLightMasterBedroomCkBox;
    private JCheckBox solidSurfaceKitchenCkBox;
    private JCheckBox stoneCounterKitchenCkBox;
    private JCheckBox studyCheckBox;
    private JCheckBox vaultedCeilingMasterBedroomCkBox;
    private JCheckBox vinylFloorEntryCkBox;
    private JCheckBox vinylFloorKitchenCkBox;
    private JCheckBox walkoutDiningRoomCkBox;
    private JCheckBox walkoutEntryCkBox;
    private JCheckBox walkoutFamilyRoomCkBox;
    private JCheckBox walkoutLivingRoomCkBox;
    private JCheckBox walkoutMasterBedroomCkBox;
    private JCheckBox walkoutStudyCkBox;
    private JCheckBox wetBarLivingRoomCkBox;
    private JCheckBox windowTreatDiningRoomCkBox;
    private JCheckBox windowTreatEntryCkBox;
    private JCheckBox windowTreatFamilyRoomCkBox;
    private JCheckBox windowTreatKitchenCkBox;
    private JCheckBox windowTreatLivingRoomCkBox;
    private JCheckBox windowTreatMasterBedroomCkBox;
    private JCheckBox windowTreatStudyCkBox;
    private JCheckBox woodCabinetsKitchenCkBox;
    private JCheckBox woodFloorDiningRoomCkBox;
    private JCheckBox woodFloorEntryCkBox;
    private JCheckBox woodFloorFamilyRoomCkBox;
    private JCheckBox woodFloorKitchenCkBox;
    private JCheckBox woodFloorLivingRoomCkBox;
    private JCheckBox woodFloorMasterBedroomCkBox;
    private JCheckBox woodFloorStudyCkBox;
    private JCheckBox wwCarpetDiningRoomCkBox;
    private JCheckBox wwCarpetFamilyRoomCkBox;
    private JCheckBox wwCarpetLivingRoomCkBox;
    private JCheckBox wwCarpetMasterBedroomCkBox;
    private JCheckBox wwCarpetStudyCkBox;
    private JComboBox airConditionYesNoComboBox;
    private JComboBox apartmentLevelComboBox;
    private JComboBox bathComboBox;
    private JComboBox bdrmComboBox;
    private JComboBox diningRoomYesNoComboBox;
    private JComboBox disabilityAccessYesNoComboBox;
    private JComboBox familyRoomYesNoComboBox;
    private JComboBox firstFloorBathroomYesNoComboBox;
    private JComboBox firstFloorBdrmYesNoComboBox;
    private JComboBox garageSpacesComboBox;
    private JComboBox heatPaidComboBox;
    private JComboBox separateFurnaceYesNoComboBox;
    private JComboBox separateGasYesNoComboBox;
    private JComboBox waterPaidComboBox;
    private JFormattedTextField listDateTextField;
    private JLabel airConSeparateLabel;
    private JLabel apartmentLevelLabel;
    private JLabel bathLabel;
    private JLabel bdrmLabel;
    private JLabel commentDiningRoomLabel;
    private JLabel commentEntryLabel;
    private JLabel commentFamilyRoomLabel;
    private JLabel commentKitchenLabel;
    private JLabel commentLivingRoomLabel;
    private JLabel commentMasterBedroomLabel;
    private JLabel commentStudyLabel;
    private JLabel disabilityAccessLabel;
    private JLabel garageSpacesLabel;
    private JLabel heatPaidLabel;
    private JLabel listDateLabel;
    private JLabel lotDimensionsLabel;
    private JLabel lotSizeLabel;
    private JLabel numberOfFireplacesLabel;
    private JLabel numberOfRoomsLabel;
    private JLabel tenantNameLabel;
    private JLabel schoolDistrictLabel;
    private JLabel sepFurnaceLabel;
    private JLabel sepGasElectricLabel;
    private JLabel waterPaidLabel;
    private JLabel yearBuiltLabel;
    private JList roomListHolder;
    private JPanel dimOfDiningRoom;
    private JPanel dimOfEntryRoom;
    private JPanel dimOfFamilyRoom;
    private JPanel dimOfKitchen;
    private JPanel dimOfMasterBedroom;
    private JPanel dimOfStudy;
    private JScrollPane listScroller;
    private JTextArea entryCommentTextArea;
    private JTextField DiningRoomLength;
    private JTextField DiningRoomWidth;
    private JTextField entryRoomLength;
    private JTextField entryRoomWidth;
    private JTextField familyRoomLength;
    private JTextField familyRoomWidth;
    private JTextField kitchenLength;
    private JTextField kitchenWidth;
    private JTextField livingRoomLength;
    private JTextField livingRoomWidth;
    private JTextField lotDimensions1Label;
    private JTextField lotDimensions2Label;
    private JTextField lotSizeTextField;
    private JTextField masterBedroomLength;
    private JTextField masterBedroomWidth;
    private JTextField numberOfFireplacesTextField;
    private JTextField numberOfRoomsTextField;
    private JTextField tenantNameTextField;
    private JTextField roomDim1TextField;
    private JTextField roomDim2TextField;
    private JTextField schoolDistrictTextField;
    private JTextField studyLength;
    private JTextField studyWidth;
    private JTextField yearBuiltTextField;
    private PropertyFeaturesPanel pfp;
    private String[] apartmentLevelSelection = {"0", "1", "2", "3"};
    private String[] bathChoices = {"1", "1.5", "2", "2.5", "3", "3.5", "4"};
    private String[] bdrmChoices = {"1", "2", "3", "4", "5"};
    private String[] garageSpacesSelection = {"0", "1", "1.5", "2", "2.5", "3"};
    private String[] ownerTenantSelection = {"Owner", "Tenant"};
    private String[] roomChoicesSelection = {"Entry", "Living Room", "Dining Room", "Kitchen", "Breakfeast Room", "Family Room", "Study", "Recreation Room", "Laundry Room", "Master Bedroom", "Bedroom 2", "Bedroom 3", "Bedroom 4", "Bedroom 5", "Bathes"};
    private String[] yesNoSelection = {"Yes", "No"};
    private TextArea diningRoomCommentTextArea;
    private TextArea familyRoomCommentTextArea;
    private TextArea KitchenCommentTextArea;
    private TextArea livingRoomCommentTextArea;
    private TextArea masterBedroomCommentTextArea;
    private TextArea studyCommentTextArea;
}
